/**
 * 
 */
package com.weidft.biz.calc;

/**
 * @author zxk
 * 
 */
public class ModolTest {

	public static void main(String[] args) {
		int base = 1 << 4;
		int all = 100000000;
		System.out.println(base);

		String hashTest = new String("Test hash");

		long start = System.currentTimeMillis();
		for (int i = 0; i < all; i++) {
			int x = hashTest.hashCode() % base;
		}
		long end = System.currentTimeMillis();
		System.out.println("'%' Cost " + (end - start) + "ms");

		start = System.currentTimeMillis();
		for (int i = 0; i < all; i++) {
			int x = hashTest.hashCode() & base;
		}
		end = System.currentTimeMillis();
		System.out.println("'&' Cost " + (end - start) + "ms");
	}
}
